package org.mysocial.datamodel;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author ivan
 * @version 1.0
 * @created 21-Jul-2011 10:00:31 PM
 */
@Entity
@Table(name = "friendship")
public class Friendship implements Serializable
{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long id;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "friendring_fk")
	private FriendsRing friendRing;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "from_account_fk")
	private Account fromAccount;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "to_account_fk")
	private Account toAccount;

	private Boolean accepted;

	public Friendship()
	{

	}

	public Boolean getAccepted()
	{
		return accepted;
	}

	public FriendsRing getFriendRing()
	{
		return friendRing;
	}

	public Account getFromAccount()
	{
		return fromAccount;
	}

	public long getId()
	{
		return id;
	}

	public Account getToAccount()
	{
		return toAccount;
	}

	public void setAccepted(Boolean approved)
	{
		this.accepted = approved;
	}

	public void setFriendRing(FriendsRing friendRing)
	{
		this.friendRing = friendRing;
	}

	public void setFromAccount(Account fromAccount)
	{
		this.fromAccount = fromAccount;
	}

	public void setId(long id)
	{
		this.id = id;
	}

	public void setToAccount(Account toAccount)
	{
		this.toAccount = toAccount;
	}
}